package se_test;

public class Test2 {
    public static int n = 1;
    public static void hanoi(int num,char begin,char end,char middle){
        if(num == 1){
            System.out.println("第"+ n + "次：从" + begin + "移动到" + end);
            n++;
        }else{
            hanoi(num -1,begin,middle,end);
            System.out.println("第"+ n + "次：从" + begin + "移动到" + end);
            n++;
            hanoi(num - 1,middle,end,begin);
        }
    }
    public static void main(String[] args) {
        hanoi(3,'A','B','C');
        System.out.println("一共移动了" + (n - 1) + "次");
    }
    public static int max(int a,int b){
        if(a > b){
            return a;
        }else{
            return b;
        }
    }
    public static double max(double a,double b,double c){
        if(a > b){
            if(a > c){
                return a;
            }else{
                return c;
            }
        }else{
            if(b > c){
                return b;
            }else{
                return c;
            }
        }
    }
    public static void main3(String[] args) {
        System.out.println(max(23,34));
        System.out.println(max(1.0,1.9,2.1));
    }
    public static int sum(int a,int b){
        return a + b;
    }
    public static double sum(double a,double b,double c){
        return a + b + c;
    }
    public static void main2(String[] args) {
        System.out.println(sum(1,2));
        System.out.println(sum(1.0,2.0,3.0));
    }
    public static int max2(int a,int b){
        if(a > b){
            return a;
        }else{
            return b;
        }
    }
    public static int max3(int a,int b,int c){
        if(max2(a,b) > c){
            return max2(a,b);
        }else{
            return c;
        }

    }
    public static void main1(String[] args) {
        System.out.println(max2(1, 2));
        System.out.println(max3(1, 2, 3));
    }
}
